Okay, so I'm not playing with Word anymore, now I'm trying to figure out filters. Here is my question: I am trying to create a program which will use one filter, but the one filter is combination of many filters. However, I won't know how many filters I am going to have. (Basically, I'm doing a filter to find a specific CR, then have a for loop to figure out how many objects are in the filtered module. My problem comes in the next part of the program. I want to do something that I don't see why it wouldn't be possible: 1) Initialize a string array called "filters" which is "j" long (j was previously defined as the number of objects in my module) 2) Loop through all of the objects, each time: 2A) Finding the length of the "Object Number" Attribute 2B) Finding the last period in the "Object Number" attribute 2C) Taking a substring of the "Object Number" attribute from the beginning of the attribute to the last period Then I want to: 2D) make the filters array (at index "L", where L is 0, and then incremented as each index is filled) equal the following filter (putting it in as a string, since I'm not sure that I can create an array of filters?): filters[L] = "contains(attribute ""Object Number"". objNumShort, false)" //(where objNumShort is the substring of the Object Number attribute) Then I want to do something like: int k = 0 Filter f3 = filters[k] for(k = 1; k <= L; k++) { f3 = f3 + "||" + filters[k] }
I'm getting errors in the places that I italicized, and I'm having problems figuring out what is wrong. Since you can just type a filter in as a "string", shouldn't this work to make f3 be all of the filters in the "filters" array "OR'ed" together? And if not, any ideas as to what I could do to fix this? Thanks! josiah820 - Thu May 30 15:32:56 EDT 2013 |
Re: "Playing" With Filters I guess it would be wrong to say I'm trying to "figure out" filters... I'm trying to dig deeper into filters... |
Re: "Playing" With Filters If you figure to save a view perhaps "CR 221 View" showing all objects associated with CR #221 then you want to use "Filters". Otherwise I think you do not. If you just wish to make some report or just, for now, show objects associated it is easier to just evaluate each Object and "accept" or "reject" it.
Accept/reject filters cannot be saved in a view. As for your code snippette [1] I notice your period-prefix algorithm, when encounting text object "3.2.0-2" will result in a Filter " Object Number contains "3.2"", which will match object 4.3.2 as well as 3.2, which is not what you want. Perhaps use Absolute Number instead. [2] ... you can "or" the "Filters" or "or" the "strings", but not both at the same time. You may not concatenate a 'string' with a 'Filter'. I don't know what your plus signs are doing. I think you want this:\
-Louie |
Re: "Playing" With Filters llandale - Fri May 31 14:35:35 EDT 2013 If you figure to save a view perhaps "CR 221 View" showing all objects associated with CR #221 then you want to use "Filters". Otherwise I think you do not. If you just wish to make some report or just, for now, show objects associated it is easier to just evaluate each Object and "accept" or "reject" it.
Accept/reject filters cannot be saved in a view. As for your code snippette [1] I notice your period-prefix algorithm, when encounting text object "3.2.0-2" will result in a Filter " Object Number contains "3.2"", which will match object 4.3.2 as well as 3.2, which is not what you want. Perhaps use Absolute Number instead. [2] ... you can "or" the "Filters" or "or" the "strings", but not both at the same time. You may not concatenate a 'string' with a 'Filter'. I don't know what your plus signs are doing. I think you want this:\
-Louie
|
Re: "Playing" With Filters josiah820 - Fri May 31 15:15:37 EDT 2013
You want the single parent and all that parent's children included? Are you sure you don't just want all the ancestors of your accepted object?
there is an "ancestors" feature of the filter you could turn on. -Louie
|
Re: "Playing" With Filters llandale - Fri May 31 16:11:03 EDT 2013 You want the single parent and all that parent's children included? Are you sure you don't just want all the ancestors of your accepted object?
there is an "ancestors" feature of the filter you could turn on. -Louie
I know about the ancestors feature. I tried using it (and did so successfully), but it's not what my supervisor wants. He wants the single parent of the object and all of the objects "siblings". |
Re: "Playing" With Filters josiah820 - Mon Jun 03 08:39:54 EDT 2013 I know about the ancestors feature. I tried using it (and did so successfully), but it's not what my supervisor wants. He wants the single parent of the object and all of the objects "siblings". So for req "R", you want "R"s parent and all of "R"s siblings. Try this:
-Louie |
Re: "Playing" With Filters llandale - Tue Jun 04 12:11:31 EDT 2013 So for req "R", you want "R"s parent and all of "R"s siblings. Try this:
-Louie Okay, thanks! But I'm getting a null Object do loop parameter was passed error for some reason. I've attached my code. Also, is there a way to "override" the filter, while still leaving it on? I want to show the parent and siblings of the object which were modified by a CR, but still be able to loop through the rest of the objects that were modified by the CR and show their parent and siblings. Is this possible? I've done everything that I can think to do. Thanks! Attachments CR-CRG In Project Level Up.dxl |
Re: "Playing" With Filters josiah820 - Tue Jun 04 13:40:20 EDT 2013 Okay, thanks! But I'm getting a null Object do loop parameter was passed error for some reason. I've attached my code. Also, is there a way to "override" the filter, while still leaving it on? I want to show the parent and siblings of the object which were modified by a CR, but still be able to loop through the rest of the objects that were modified by the CR and show their parent and siblings. Is this possible? I've done everything that I can think to do. Thanks!
I think you are saying that you want to "filter" for objects associated with a particular CR; then show that object, it's immediate parent, and all it's immediate siblings. If so, I would do this:
That may look like this
So. You need to understand:
-Louie |
Re: "Playing" With Filters llandale - Tue Jun 04 15:12:34 EDT 2013
I think you are saying that you want to "filter" for objects associated with a particular CR; then show that object, it's immediate parent, and all it's immediate siblings. If so, I would do this:
That may look like this
So. You need to understand:
-Louie Okay, I made some changes to the code and I THINK I made the right changes, but it's acting weird. I edited my test module and put CR00444 into the "CR" attribute in one object. However, when I run the program, every single object is "grayed out" (I'm assuming that means it was "rejected". yet EVERY object is exported in the "Export to Word" box. Does accepting and rejecting not have any effect on if the object is exported or not, and how can I "hide" the objects that I don't want to be exported, based on what was accepted or rejected, so that only the "accepted" objects are included in the export? Thanks for your help Attachments CR-CRG In Project Level Up.dxl |
Re: "Playing" With Filters josiah820 - Wed Jun 05 09:06:50 EDT 2013 Okay, I made some changes to the code and I THINK I made the right changes, but it's acting weird. I edited my test module and put CR00444 into the "CR" attribute in one object. However, when I run the program, every single object is "grayed out" (I'm assuming that means it was "rejected". yet EVERY object is exported in the "Export to Word" box. Does accepting and rejecting not have any effect on if the object is exported or not, and how can I "hide" the objects that I don't want to be exported, based on what was accepted or rejected, so that only the "accepted" objects are included in the export? Thanks for your help It's probably a little late, but I did something similar to filter for change request changes. For our reviews for a CR, we wanted to include the entire section where a proposed change was being made. Made it easier to review the change in it's context and also was easier to see what another object also needed a change. The filter was done by using a string array that got converted into the appropriate filter. I used a regular expression ([0-9.]+)(.0-[0-9]) on the object number so I could get the section. All of our text below headers are one level down and so have the format of xxx.xxx.0-xxx. Then after capturing each affected section, I stripped off the ending period and saved it in the 'section' array. I then made a loop through the array and built my filter by making a filter filt= filt || attribute "Object Number" >= section[cnt]. (actually it was a little more complicated than this, but this gives the general idea). I then applied the filter and refreshed the module. You could do something similar by finding the affected object, getting the object number and stripping the higher levels off, then making a filter of the object number. Hope this helps, Greg |
Re: "Playing" With Filters GregM_dxler - Wed Jun 05 09:45:42 EDT 2013 It's probably a little late, but I did something similar to filter for change request changes. For our reviews for a CR, we wanted to include the entire section where a proposed change was being made. Made it easier to review the change in it's context and also was easier to see what another object also needed a change. The filter was done by using a string array that got converted into the appropriate filter. I used a regular expression ([0-9.]+)(.0-[0-9]) on the object number so I could get the section. All of our text below headers are one level down and so have the format of xxx.xxx.0-xxx. Then after capturing each affected section, I stripped off the ending period and saved it in the 'section' array. I then made a loop through the array and built my filter by making a filter filt= filt || attribute "Object Number" >= section[cnt]. (actually it was a little more complicated than this, but this gives the general idea). I then applied the filter and refreshed the module. You could do something similar by finding the affected object, getting the object number and stripping the higher levels off, then making a filter of the object number. Hope this helps, Greg That was actually my original idea. I think I was running into issues because I was trying to use the "contains" filter, maybe it'll work better if I use >=. Thanks! |
Re: "Playing" With Filters GregM_dxler - Wed Jun 05 09:45:42 EDT 2013 It's probably a little late, but I did something similar to filter for change request changes. For our reviews for a CR, we wanted to include the entire section where a proposed change was being made. Made it easier to review the change in it's context and also was easier to see what another object also needed a change. The filter was done by using a string array that got converted into the appropriate filter. I used a regular expression ([0-9.]+)(.0-[0-9]) on the object number so I could get the section. All of our text below headers are one level down and so have the format of xxx.xxx.0-xxx. Then after capturing each affected section, I stripped off the ending period and saved it in the 'section' array. I then made a loop through the array and built my filter by making a filter filt= filt || attribute "Object Number" >= section[cnt]. (actually it was a little more complicated than this, but this gives the general idea). I then applied the filter and refreshed the module. You could do something similar by finding the affected object, getting the object number and stripping the higher levels off, then making a filter of the object number. Hope this helps, Greg Do you happen to have the actual code for just the filter line and would you be willing to post it? I'm running into an "Incorrect Arguments" warning for both my = sign and my || sign. I have: f2 = f2 || number(o) >= obNum[k] Thanks |
Re: "Playing" With Filters josiah820 - Wed Jun 05 10:27:42 EDT 2013 Do you happen to have the actual code for just the filter line and would you be willing to post it? I'm running into an "Incorrect Arguments" warning for both my = sign and my || sign. I have: f2 = f2 || number(o) >= obNum[k] Thanks I have two arrays, sSections contains the section number to filter for and sNextSections is the section number for the next section. Then the filter is made by the following: {code}
f1 = attribute "Object Number" >= sSections[iCnt] {code} The final filter is done by "set f1" and then refresh current Module. Hope this comes out okay in the forum. Greg |
Re: "Playing" With Filters GregM_dxler - Wed Jun 05 10:49:35 EDT 2013 I have two arrays, sSections contains the section number to filter for and sNextSections is the section number for the next section. Then the filter is made by the following: {code}
f1 = attribute "Object Number" >= sSections[iCnt] {code} The final filter is done by "set f1" and then refresh current Module. Hope this comes out okay in the forum. Greg The filter is a display filter, not an object filter (like accept o and reject o). So the filter criteria is an attribute comparison. There is a dxl command of includeLeaves. I haven't used this, but it might do what you want by using it from the parent objects. Just a thought... Good luck |
Re: "Playing" With Filters josiah820 - Wed Jun 05 09:06:50 EDT 2013 Okay, I made some changes to the code and I THINK I made the right changes, but it's acting weird. I edited my test module and put CR00444 into the "CR" attribute in one object. However, when I run the program, every single object is "grayed out" (I'm assuming that means it was "rejected". yet EVERY object is exported in the "Export to Word" box. Does accepting and rejecting not have any effect on if the object is exported or not, and how can I "hide" the objects that I don't want to be exported, based on what was accepted or rejected, so that only the "accepted" objects are included in the export? Thanks for your help Don't know about "greyed out". Line #106 you want "filtering on". This applies all the accept/reject commands. Line #107 I think you do want to "close m". I think it cleaner to move line #68 "eval_..." to after line #104. Line #40 "o = current". STOP DOING THAT. You are changing the specified Object "o".
-Louie |
Re: "Playing" With Filters llandale - Wed Jun 05 13:34:30 EDT 2013 Don't know about "greyed out". Line #106 you want "filtering on". This applies all the accept/reject commands. Line #107 I think you do want to "close m". I think it cleaner to move line #68 "eval_..." to after line #104. Line #40 "o = current". STOP DOING THAT. You are changing the specified Object "o".
-Louie Okay, so I have this... and It's working, at least when it comes to recognizing when a module has no occurrences of the CR, but when it comes to a module that DOES have the CR in it, it exports the ENTIRE module, and I can't figure out why. Any ideas? Attachments CR-CRG In Project Level Upb.dxl |
Re: "Playing" With Filters josiah820 - Wed Jun 05 14:18:05 EDT 2013 Okay, so I have this... and It's working, at least when it comes to recognizing when a module has no occurrences of the CR, but when it comes to a module that DOES have the CR in it, it exports the ENTIRE module, and I can't figure out why. Any ideas? It looks like it's going all of the way up to the "top" of the hierarchy and then going to the bottom, so that's why it's exporting everything |
Re: "Playing" With Filters josiah820 - Wed Jun 05 14:31:43 EDT 2013 It looks like it's going all of the way up to the "top" of the hierarchy and then going to the bottom, so that's why it's exporting everything You need to turn on filtering BEFORE you try to export |
Re: "Playing" With Filters llandale - Wed Jun 05 15:54:12 EDT 2013 You need to turn on filtering BEFORE you try to export Wowwwwww I'm smart.... *headdesk* thanks!! I got it! |